from threading import Thread
from time import sleep


def func1(name):
    print(f'{name}开始')
    for i in range(5):
        print(f'{name}--{i}')
        sleep(1)
    print(f'{name}结束')


if __name__ == '__main__':
    print('主线程开始')
    #创建线程
    t1 = Thread(target=func1,args=('线程1',))
    t2 = Thread(target=func1,args=('线程2',))
    #启动线程
    t1.start()
    t2.start()

    print('主线程结束')
